'use strict';

const BaseService = require('./base');

class User_bookletService extends BaseService {
  constructor(...props) {
    super('UserBooklet', ...props)
  }

  //根据字段查询获取
  async findByFields(where, findType = 'findOne') {
    const { primary_model, ctx } = this;
    return await primary_model[findType]({
      where,
      attributes: ['id', 'user_id', 'booklet_id', 'status']
    })
  }
}

module.exports = User_bookletService;
